Does Python Smell Like Java? Tool Support for Design Defect Discovery in Python

نویسندگان

  • Nicole Vavrová
  • Vadim Zaytsev
چکیده

The context of this work is specification, detection and ultimately removal of harmful patterns in source code that are associated with defects in design and implementation of software. In particular, we investigate five code smells and four antipatterns previously defined in literature. Our inquiry is about detecting those nine design defects in source code written in Python programming language, which is substantially different from all prior research, most of which concerns Java and other C-like languages. Our approach was that of software engineers: we have processed existing research literature on the topic, extracted both the abstract definitions of defects and their concrete implementation specifications, programmed them all in a tool and let it loose on a huge test set obtained from open source code from thousands of GitHub projects. When it comes to knowledge, we have found that more than twice as many methods in Python can be considered too long (statistically extremely longer than their neighbours within the same project) than in Java, but long parameter lists are seven times less likely to be found in Python code than in Java code. We have also found that Functional Decomposition, the way it was defined for Java, is not found in Python code at all, and Spaghetti Code and God Classes are extremely rare there as well. The grounding and the confidence in these results comes from the fact that we have performed our experiments on 32,058,823 lines of Python code, which is by far the largest test set for a freely available Python parser. We have also designed the experiment in such a way that it aligned with prior research on design defect detection in Java in order to ease the comparison if we treat our own actions as a partial replication. Thus, the importance of the work is both in the unique open Python grammar of highest quality, applied to millions of lines of code, and in the design defect detection tool which works on something else than Java. ACM CCS 2012 Software and its engineering→ Parsers; Software defect analysis; Patterns;

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Garbage Collection in JyNI - How to bridge Mark/Sweep and Reference Counting GC

Jython is a Java-based Python implementation and the most seamless way to integrate Python and Java. It achieves high efficiency by compiling Python code to Java bytecode and thus letting Java’s JIT optimize it – an approach that enables Python code to call Java functions or to subclass Java classes. It enables Python code to leverage Java’s multithreading features and utilizes Java’s built-in ...

متن کامل

JyNI - Using native CPython-Extensions in Jython

Jython is a Java based Python implementation and the most seamless way to integrate Python and Java. However, it does not support native extensions written for CPython like NumPy or SciPy. Since most scientific Python code fundamentally depends on exactly such native extensions directly or indirectly, it usually cannot be run with Jython. JyNI (Jython Native Interface) aims to close this gap. I...

متن کامل

A Pragmatic Approach for Building a User-friendly and Flexible UML Model Repository

In France Telecom research center in Lannion (France) we have been working for three years on OO modeling as a promising technology for unifying the representation of data. This has led us to develop a Model Repository Tool, which offers, as its default configuration, a full support for the UML 1.3 metamodel. The tool enables the manipulation of models by means of a Java or Python API. It provi...

متن کامل

OOPP: A reflective component-based middleware

Traditional middleware, like CORBA and Java RMI, are not flexible and adaptable enough for new application types that need support for multimedia, real-time and mobility. The next generation middleware platforms should be designed from the beginning with flexibility and adaptability in mind. This can be done by adopting an open engineering approach for the design of the middleware platform. Ref...

متن کامل

User-Centered Evolutionary Software Development Using Python and Java

The two language approach to software development has been investigated by several language designers. The primary hypothesis of such an approach being that both strong compile-time type checking and loose run-time type checking are desirable in evolutionary software development. Java is a strongly typed language which offers performance, robustness and modularity as such, while Python is a wea...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Programming Journal

دوره 1  شماره 

صفحات  -

تاریخ انتشار 2017